package com.lazycat.backend.controller.address;

import com.lazycat.backend.service.address.DelAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class DelAddressController {

    @Autowired
    private DelAddressService delAddressService;

    @PostMapping("/address/delete/")
    public Map<String, Object> del(@RequestBody Map<String,String> map) {
        Integer addressId = Integer.parseInt(map.get("address_id"));
        return delAddressService.del(addressId);
    }
}
